let initState = {
     name:"张三",
     age:18
}
function homeReducer(state=initState,action){
    switch(action.type){
        case "ADD_AGE":
            let newState = {...state};
            newState.age+=action.age;
            return newState;
        case "SET_NAME":
            let setState = {...state};
            setState.name = action.name;
            return setState;
        default:
            return state
    }
}

export default homeReducer;